/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package collision;

import java.math.BigInteger;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author root
 */
public class Crono extends Thread {
    private boolean run = true;
    private BigInteger transcurrido = BigInteger.ZERO;

    public void run() {
        while(run) {
            try {
                sleep(1);
                transcurrido = transcurrido.add(BigInteger.ONE);
            } catch (InterruptedException ex) {
                Logger.getLogger(Crono.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
    public void stopCrono(Thread crono) {
         run = false;
         float cambio = transcurrido.longValue();
         System.out.println(cambio + " ms" + " == " + cambio/1000 + " s" + " == " + (int)(cambio/1000)/3600 + " h");
         
    }


}
